package models

import (
	"github.com/cy77cc/hioshop/global"
)

type Specification struct {
	Model
	Name      string `json:"name" gorm:"type:varchar(60);default:''"`
	SortOrder uint   `json:"sort_order" gorm:"type:int unsigned;default:0"`
	Memo      string `json:"memo" gorm:"type:varchar(255);default:''"`
}

func (Specification) GetSpecificationById(id uint) (s Specification, err error) {
	err = global.DB.Model(&Specification{}).Where("id = ?", id).Find(&s).Error
	return
}
